#ifndef _DistributionQaFigures_H_
#define _DistributionQaFigures_H_

//
// DistributionQaFigures.h
//
// Created by TB on 12/5/11.
// Copyright 2011 BNL. All rights reserved.
//

#include <cstdlib>
#include <list>

#include <TObject.h>
#include <TH1D.h>
#include <TH2D.h>

class TDirectory;
class TObject;

namespace tppmc {
   
   class Distributions;
   
   /* Figures for fragmentation to pi+, K+ and proton
   class FragmentationQaFigures {
      
   public:
      
      
   };
    */
   
   class FragmentationFunction;
   class Parton;
   
   /**
    Generates a set of standard QA plots from a collection of distributions
    */
   class DistributionQaFigures {
      
   public:
      
      /**
       Initialise all figures.
       If the TDirectory argument is non-NULL, all figures are associated
       with the specified directory.
       Otherwise they are associated with the current ROOT directory, if
       one exists, or no directory if not.
       */
      DistributionQaFigures(TDirectory* = NULL);
      
      /**
       Create and fill all histograms
       */
//      DistributionQaFigures(const Distributions&,
//                          TDirectory*);
      
      virtual ~DistributionQaFigures();
      
      /** Fill all figures from a distribution collection */
      virtual void Fill(Distributions&);
      
      /** Write all figures to their associated directory */
      virtual void Write();
      
      virtual void Create(TDirectory*);
      
      TH1D fuquark;
      TH1D fubquark;
      TH1D fdquark;
      TH1D fdbquark;
      TH1D fsquark;
      TH1D fsbquark;
      TH1D fgluon;
      
      TH1D fkuquark;
      TH1D fkubquark;
      TH1D fkdquark;
      TH1D fkdbquark;
      TH1D fksquark;
      TH1D fksbquark;
      TH1D fkgluon;
      
      TH1D fpuquark;
      TH1D fpubquark;
      TH1D fpdquark;
      TH1D fpdbquark;
      TH1D fpsquark;
      TH1D fpsbquark;
      TH1D fpgluon;
      
      TH2D fuquarkc;
      TH2D fubquarkc;
      TH2D fdquarkc;
      TH2D fdbquarkc;
      
      TH1D favff;
      TH1D unfavff;
      
      TH1D ratiofav;
      TH1D ratiounfav;
      
      TH1D ratiofav2;
      TH1D ratiounfav2;
      
      TH1D transdist_upq;
      TH1D transdist_dnq;
      TH1D transdist_sb;
      
      TH1D transversity_upq;
      TH1D transversity_dnq;
      TH1D transversity_upb;
      TH1D transversity_dnb;
      
      TH1D unpol_pdf;
      
      TH1D sivers_upq;
      TH1D sivers_dnq;
      TH1D sivers_upb;
      TH1D sivers_dnb;
      TH1D sivers_sq;
      TH1D sivers_sb;
      TH1D sivers_glu;
      
      TH1D sivers_upq_k;
      TH1D sivers_dnq_k;
      TH1D sivers_upb_k;
      TH1D sivers_dnb_k;
      TH1D sivers_sq_k;
      TH1D sivers_sb_k;
      TH1D sivers_glu_k;
      
      TH2D fffav2d;
      
      std::list<TH1*> mFigures;
      
      virtual void Fill(unsigned ntimes,
                        FragmentationFunction&,
                        TH1&,
                        const Parton&);
   };
   
} // namespace tppmc

#endif
